<?php
$virual = 0;
include 'base.php';

Base::import('controller.front.FrontController');

$dbConfig = Base::getConfig('database.default');
Db::instance($dbConfig);

if(!$virual){
    $module = isset($_GET['m']) ? $_GET['m'] : 'default';
    $controller = isset($_GET['c']) ? $_GET['c'] : 'default';
    $action = isset($_GET['a']) ? $_GET['a'] : 'index';
}else{
    $module = '';
    $controller = '';
    $action = '';
}

$object  = Controller::loadController('front', $module, $controller);
if($object && $object instanceof FrontController){
    $object->setAction($action);
    $object->run();
}else{
    exit("no vaild $module, $controller");
}

exit;
echo "<hr />";
echo "$module,$controller,$action";
echo "<hr />";

//print_r($_SERVER);
